export default {
	base:"http://120.25.145.214/tss/",
	cors:"cors",
	changeDate:(timestring)=>{
		if(timestring.toString().indexOf('-')=='-1'){
			const tt=new Date(parseInt(timestring)).toLocaleString().replace(/\//g, "-").replace(/下|上/g," ").substring(0,10)
			return tt;	
		}else{
			const ts = Date.parse(new Date(timestring));
			return ts;
		}
		
	},
	postBody:(json)=>{
		if(typeof json=="object"){
			let result='';
			for(var i in json){
				result+=i+"="+json[i]+"&"
			}
			return result.substring(0,result.length-1);
		}
	},
	changeCurrent(url){
		switch(url){
			case 'course':return [["sub1"],['1']];break;
			case 'courseAdd':return [["sub1"],['1']];break;
			case 'courseUpdate':return [["sub1"],['1']];break;
			case 'courseNotic':return [["sub1"],['2']];break;
			case 'courseSign':return [["sub1"],['3']];break;
			case 'courseSignAdd':return [["sub1"],['3']];break;
			case 'courseSignResult':return [["sub1"],['3']];break;
			case 'courseExamine':return [["sub1"],['4']];break;
			case 'eleList':return [["sub2"],['5']];break;
			case 'eleOperate':return [["sub2"],['6']];break;
			case 'studentCourse':return [["sub3"],['7']];break;
			case 'studentCourseAddone':return [["sub3"],['7']];break;
			case 'student':return [["sub3"],['8']];break;
			case 'studentUpdate':return [["sub3"],['8']];break;
			case 'questionAdd':return [["sub4"],['9']];break;
			case 'question':return [["sub4"],['9']];break;
			case 'questionResult':return [["sub4"],['9']];break;
			case 'questionUpdate':return [["sub4"],['9']];break;
			case 'questionDetial':return [["sub4"],['9']];break;
			case 'wall':return [["sub5"],['11']];break;
			case 'userRegister':return [["0"],['0']];break;
			default :return [["sub1"],['1']];break;
		}
	}
}